package cn.kgc.service.impl;

import cn.kgc.dao.devuser.DevUserMapper;
import cn.kgc.pojo.DevUser;
import cn.kgc.service.DevUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class DveUserServiceImpl implements DevUserService {
        @Resource
        private DevUserMapper devUserMapper;
        @Override
        public DevUser login(String devCode, String devPassword){
            try {
                //调用登录的方法
                DevUser devUser=devUserMapper.findByDevCode(devCode);
                if (devUser!=null){
                    //验证密码是否正确
                    if(devUser.getDevPassword().equals(devPassword)){
                        return devUser;
                    }
                }
            } catch (RuntimeException e) {
                e.printStackTrace();
                throw e;
            }
            return null;
    }
}
